#!/usr/bin/env python

# How many n-digit positive integers exist which are also an nth power?

# 2010-04-10
if __name__ == "__main__":
	count = 0
	for i in xrange(100):
		for j in xrange(100):
			if len(str(i ** j)) == j :
				print i," ^ " , j
				count += 1

	print count
